import sys
import os

sys.path.append('../../src/python/m5/util')
sys.path.append('../../src/python/')

from jobfile import *

class Flags(Data):
    def __init__(self, name, desc, **kwargs):
        super(Flags, self).__init__(name, desc, **kwargs)

graph_flags1 = Flags('graph_flags', 'This contains flags for graphing',graph_group=True,graph_bars=False)
conf1 = Configuration('crafty-dist-fm-pb-pmd-nw1-64IQ-8b-hb-3-2','One of the simple benches',flags=graph_flags1)
grp1 = conf1.group('crafty-dist-fm-pb-pmd-nw1-64IQ-8b-hb-3-2','This is group1',flags=graph_flags1)
#grp2 = conf1.group('simplebench1','Group2',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags1)
opt1 = grp1.option('crafty-dist-fm-pb-pmd-nw1-64IQ-8b-hb-3-2','This is option1')
#opt2 = grp1.option('gzip_source-simple-fastMem-test','This is option2')

#subopt1 = opt1.suboption('log_t.tst','I\'m suboption1',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags1)
#subopt2 = opt1.suboption('atan_t.tst','I\'m suboption2',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags1)

#opt3 = grp2.option('atan_t.tst','atan_t.tst',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags1)
#opt4 = grp2.option('log_t.tst','log_t.tst',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags1)
#subopt2 = opt2.suboption('atan_t.tst','I\'m suboption2',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags1)
#opt2 = grp1.option('atan_t.tst','I\'m option2',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags1)
#conf1.job(opt1)


#graph_flags2 = Flags('graph_flags', 'This contains flags for graphing',graph_group=True,graph_bars=True)
#conf2 = Configuration('conf2','One of the simple benches',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags2)
#grp2 = conf1.group('group1','Group1',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags2)
#opt2 = grp2.option("simplebench",'I\'m option1',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags2)
#subopt2 = opt2.suboption('atan_t.tst','I\'m suboption1',dbhost='localhost',statdb='pengfei',system='system',flags=graph_flags2)

#conf = [conf1,conf2]
conf = conf1
#print conf.groups()
#conf.printinfo()
#print conf

